package commonClass;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;

import javax.imageio.ImageIO;

public class GetImg {
	/**
	 * 获取到图片的宽带和高度
	 * @param args
	 * @throws IOException
	 */
	public static void main(String[] args) throws IOException {
		File file = new File("C:/pic/newbg_1.png");
		FileInputStream fis = new FileInputStream(file);
		BufferedImage bufferedImg = ImageIO.read(fis); 
		int imgWidth = bufferedImg.getWidth();
		int imgHeight = bufferedImg.getHeight();
		System.out.println("宽度："+imgWidth+";高度:"+imgHeight);
	}

}
